package org.zjx.strategy.impl;

import org.zjx.action.Action;
import org.zjx.action.game.gather.GatherPropAction;
import org.zjx.action.route.BaseRouteAction;
import org.zjx.action.route.RunningAction;
import org.zjx.action.service.AccountAction;
import org.zjx.core.IWindow;
import org.zjx.core.impl.GameWindow;
import org.zjx.entity.Address;
import org.zjx.state.AccountState;
import org.zjx.state.ItemState;
import org.zjx.strategy.IStrategy;

import java.awt.*;

public class TestStrategy implements IStrategy {

    @Override
    public Action analyze(IWindow window) {
        AccountState accountState = window.getState().getState(AccountState.class);
        if (accountState == null) {
            return new AccountAction(window);
        }

        ItemState itemState = window.getState().getState(ItemState.class);
        if (itemState == null) {
            return new GatherPropAction(window);
        }

//        return new BaseRouteAction(window,new Address("长安城",385,64));
        return new BaseRouteAction(window,new Address("回春堂",24,58));
    }

    @Override
    public String getName() {
        return "测试策略";
    }

    @Override
    public int getPriority() {
        return 8;
    }

    @Override
    public boolean isApplicable(IWindow window) {
        return window instanceof GameWindow;
    }
}
